<% layout("/inc/layout.html"){ %> 

<%include("/inc/top_banner.html"){} %>

<div class="am-g am-container cms-container">

  <div class="am-u-md-8">
    <div id="view_article_list"></div>
    <div id="page1"></div>
  </div>

  <div class="am-u-md-4 blog-sidebar">
    <div class="am-panel-group">
      <section class="am-panel am-panel-default">
        <div class="am-panel-hd">${column.name}</div>
        <div class="am-panel-bd"><p>${column.remarks}</p></div>
      </section>
      <section class="am-panel am-panel-default">
        <div class="am-panel-hd">栏目列表</div>
        <ul class="am-list blog-list">
        <%
          var sublist = cmsfn.listSubCloumns(column_id);
          for(var sub in sublist){
        %>
          <li><a href="${BASE}/column/${sub.id}">${sub.name}</a></li>
        <% } %>
        </ul>
      </section>
    </div>
  </div>
</div>

<script type="text/javascript">
function demo(curr){

	var pager_pageSize = $("#pager_pageSize").val()||2;
	$("#view_article_list").load("${BASE}/article/page",
		{
			columnId:${child_column_id},
			pageStart:curr,
			pageSize:pager_pageSize
			
		},function(){
			var pager_pageCount = $("#pager_pageCount").val()||3;
			laypage({
            cont: 'page1', //容器。值支持id名、原生dom对象，jquery对象。【如该容器为】：<div id="page1"></div>
            pages: pager_pageCount, //通过后台拿到的总页数
            curr: curr || 1, //当前页
            jump: function(obj, first){ //触发分页后的回调
            	if(!first){
            		demo(obj.curr);
            	}
            		
            }
        });
		
	});
};
demo(1);
</script>

<%}%>
